<!--#include file="Chklogin.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->

<%if request("action")="save" then
name=request("name")
pass=md5(md5(request("pass")))
lastsj=now
lastip=Request.serverVariables("REMOTE_ADDR")
n=0
  set rs=server.createobject("adodb.recordset")
  sql="select * from admin where (id is null)" 
  rs.open sql,conn,1,3
  rs.addnew
  rs("username")=name
  rs("password")=pass
  rs("lastip")=lastip
  rs("lastsj")=lastsj
  rs("n")=n
  rs.update
  rs.close
  set rs=nothing
  set conn=nothing
  response.Redirect("admin_name.asp")
end if
%>
<%if request("action")="save2" then
co=request("co")
url=request("url")
tel=request("tel")
fax=request("fax")
email=request("email")
  set rs=server.createobject("adodb.recordset")
  sql="select * from setupmsg where id=1" 
  rs.open sql,conn,1,3
  rs("co")=co
  rs("url")=url
  rs("tel")=tel
  rs("fax")=fax
  rs("email")=email
  rs.update
  rs.close
  set rs=nothing
  set conn=nothing
  response.Redirect("admin_name.asp")
end if
%>
<%if request("action")="del" then
sql="delete from admin where id="&request("id")&""
conn.execute(sql)
set conn=nothing
response.redirect "admin_name.asp"
end if
%>